//
//  LcbLog.m
//  lcb
//
//  Created by lcb on 16/5/23.
//  Copyright © 2016年 lcb. All rights reserved.
//

#import "LcbLog.h"
#import "iConsole.h"

@interface LcbLog ()
{
    
}
@end

@implementation LcbLog
LcbSingletonM(LcbLog)
+(void)setLoglevel:(LogLevel)Loglevel
{
    iConsoleLogLevel level = iConsoleLogLevelNone;
    switch (Loglevel) {
        case LogLevelNone:
            level = iConsoleLogLevelNone;
            break;
        case LogLevelCrash:
            level = iConsoleLogLevelCrash;
            break;
        case LogLevelError:
            level = iConsoleLogLevelError;
            break;
        case LevelWarning:
            level = iConsoleLogLevelWarning;
            break;
        case LevelInfo:
            level = iConsoleLogLevelInfo;
            break;
        default:
            break;
    }
    [iConsole sharedConsole].logLevel = level;
}
+(void)setSaveLogToDisk:(BOOL)saveLogToDisk
{
    [iConsole sharedConsole].saveLogToDisk = saveLogToDisk;
}
+ (void)log:(NSString *)format, ...
{
    va_list argList;
    va_start(argList, format);
    [self log:format args:argList];
    va_end(argList);
}

+ (void)info:(NSString *)format, ...
{
    va_list argList;
    va_start(argList, format);
    [self info:format args:argList];
    va_end(argList);
}

+ (void)warn:(NSString *)format, ...
{
    va_list argList;
    va_start(argList, format);
    [self warn:format args:argList];
    va_end(argList);
}

+ (void)error:(NSString *)format, ...
{
    va_list argList;
    va_start(argList, format);
    [self error:format args:argList];
    va_end(argList);
}

+ (void)crash:(NSString *)format, ...
{
    va_list argList;
    va_start(argList, format);
    [self crash:format args:argList];
    va_end(argList);
}

+ (void)log:(NSString *)format args:(va_list)argList
{
    [iConsole log:format args:argList];
}
+ (void)info:(NSString *)format args:(va_list)argList
{
    [iConsole info:format args:argList];
}
+ (void)warn:(NSString *)format args:(va_list)argList
{
    [iConsole warn:format args:argList];
}
+ (void)error:(NSString *)format args:(va_list)argList
{
    [iConsole error:format args:argList];
}
+ (void)crash:(NSString *)format args:(va_list)argList
{
    [iConsole crash:format args:argList];
}

+ (void)clear
{
    [iConsole clear];
}
@end
